package com.adam.seataintegral.integral.controller;


import com.adam.seataintegral.integral.entity.Integral;
import com.adam.seataintegral.integral.service.IntegralService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author LiDaXing
 * @since 2023-04-03
 */
@RestController
@RequestMapping("/integral/integral")
public class IntegralController {

    @Autowired
    private IntegralService integralService;

    @RequestMapping(value = "/reduceIntegral")
    public void reduceIntegral (int point, String commodityCode) {
        Integral integral = new Integral();
        integral.setPoint(point);
        integral.setCommodityCode(commodityCode);
        integralService.reduceIntegral(integral);
    }
}
